import request from '@/utils/request'

// 查询部门
export function department() {
  return request({
    url: '/company/department',
    method: 'get'
  })
}

// 删除部门
export function delpartment(id) {
  return request({
    url: '/company/department/' + id,
    method: 'DELETE'
  })
}

// 新增部门
export function addDepartment(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

// 根据id获取部门详情
export function companyDepartment(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'get'
  })
}

// 根据id修改部门内容
export function getDepartment(data) {
  return request({
    url: '/company/department/' + data.id,
    method: 'put',
    data
  })
}
